package demo1;
//牛客网:五子棋

import java.util.Scanner;

public class Main{
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        String[] str = new String[21];
        while(scanner.hasNext()) {
            for(int i = 0; i<20; i++) {
                str[i] = scanner.nextLine();
            }

            boolean ret = false;
            for(int i = 0; i<20; i++) {
                for(int j =0 ; j<20; j++) {
                    if(str[i].charAt(j)== '+' ||str[i].charAt(j)== '*' ) {
                        ret = check(i, j, str);
                        if(ret == true) break;
                    }
                }
                if(ret == true) break;
            }

            if(ret == true) System.out.println("Yes");
            else System.out.println("No");
        }
    }
    public static boolean check(int x, int y, String[] str) {
        char ch = str[x].charAt(y);
        //枚举每个方向
        for(int i = 0; i<8; i++) {
            //枚举5颗棋子
            int j;
            for(j = 0; j<5; j++) {
                int dx = x + xx[i]*j;
                int dy = y + yy[i]*j;
                if(dx<0||dx>=20||dy<0||dy>=20) {
                    break;
                }
                if(str[dx].charAt(dy)!=ch) {

                    break;
                }
            }
            if(j == 5) return true;
        }

        return false;
    }
    public static int[] xx = {1,1,1,-1,-1,-1,0,0};
    public static int[] yy = {1,-1,0,1,-1,0,1,-1};
}

